<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\web\View;

/* @var $this yii\web\View */
/* @var $model app\models\FamilyinfoModel */
/* @var $form yii\widgets\ActiveForm */

$url=\Yii::getAlias('@web');
$js3=<<< Js
function myAjax(){
		var x=$("#familyinfomodel-stu_id").val();
		$.ajax({
                    url: '$url/personinfo/getname?stuid='+x,
                    type: 'get',
                    dataType: 'text',
                    success: function (data) {
                       $("#familyinfomodel-stu_name").val(data);
                    }
                });
}
Js;
$this->registerJs($js3, View::POS_END, 'myAjax0');

?>

<div class="familyinfo-model-form">

    <?php $form = ActiveForm::begin(); ?>   

     <?= $form->field($model, 'stu_id')->textInput(['maxlength' => true,
    		'onblur'=>'myAjax()',
    ]) ?>
    
   <?= $form->field($model, 'stu_name')->textInput(['maxlength' => true,
    		'readonly'=>true,
    ]) ?>

    <?= $form->field($model, 'address')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'recipient')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'postal_code')->textInput() ?>

   <?= $form->field($model, 'economic_status')->dropDownList([
       '特别困难'=>'特别困难',
       '困难'=>'困难',
       '突发事件特殊困难'=>'突发事件特殊困难',
       '不困难'=>'不困难',
        ])->label('家庭经济状况(需根据学校认定结果填写)') ?>

    <?= $form->field($model, 'load')->dropDownList(['未办理'=>'未办理',
    		'生源地贷款'=>'生源地贷款',
    		'校园地贷款'=>'校园地贷款',
    		]) ?>
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '创建' : '修改', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
